package com.xzk.ExpressInnWeb.service;

import com.xzk.ExpressInnWeb.bean.Courier;
import com.xzk.ExpressInnWeb.dao.BaseCourierDao;
import com.xzk.ExpressInnWeb.dao.daoImp.CourierDaoMySQL;

import java.util.Date;
import java.util.List;
import java.util.Map;

public class CourierService {
    
    private static BaseCourierDao dao = new CourierDaoMySQL();

    public static Courier findCourierByID(int id) {
        return dao.findCourierByID(id);
    }

    public static Map<String, Integer> consoleCourier() {
        return dao.consoleCourier();
    }

    public static List<Courier> findAllCourier(boolean split, int offset, int limit) {
        return dao.findAllCourier(split, offset, limit);
    }

    public static Courier findCourierByPhoneNum(String staffphone) {
        return dao.findCourierByPhoneNum(staffphone);
    }

    public static boolean insertCourier(Courier courier) {
        return dao.insertCourier(courier);
    }

    public static boolean updateCourier(int id, Courier courier) {
        return dao.updateCourier(id, courier);
    }

    public static void updateDelivery(String staffphone) {
        dao.updateDelivery(staffphone);
    }

    public static boolean deleteCourier(int id) {
        return dao.deleteCourier(id);
    }

    public static void updateLoginTime(String staffphone, Date date) {
        dao.updateLoginTime(staffphone, date);
    }

    public static boolean login(String staffphone, String password) {
        return dao.login(staffphone, password);
    }

}
